
class ExaminationResoult < ActiveRecord::Base
  has_many :param_resoults
  belongs_to :order_examination
  belongs_to :user
  belongs_to :executing_user, :foreign_key => "executing_user_id", :class_name => "User"

  #def examination_type_name
  #  "#{self.order_examination.examination_type.name}"
  #end

  def examination_number
    self.order_examination_id
  end

  def to_label
    "Wynik nr. #{self.id}"
  end

  def param_resoult_attributes=(param_resoult_attributes)
    param_resoult_attributes.each do |attributes|
      param_resoults.build(attributes)
    end
  end

end
